Skip to content

fix unit 15 README.md final example code bug#1070

Merged
koreyspace merged 1 commit into
microsoft:mainfrom
mwarden:15-fix-bug-python-example-query-rag
Jan 12, 2026
Merged

fix unit 15 README.md final example code bug#1070
koreyspace merged 1 commit into
microsoft:mainfrom
mwarden:15-fix-bug-python-example-query-rag

Conversation

@mwarden
Copy link
Copy Markdown
Contributor

@mwarden mwarden commented Dec 22, 2025

Final example in unit 15 appears to have a bug. The python code retrieves relevant chunks and appends to history[], then finally appends the user query to history[], but then only sends the last entry of history[] (the user query) to the LLM. This means the RAG steps do not benefit the LLM query. I'm not sure the intent of the history[-1] line, but I am certain the intent is not what the code currently does. I made a reasonable assumption that the code would be closer or equal to the author's intent if the full history[] were joined and sent to the LLM.

Final example in unit 15 appears to have a bug. The python code retrieves relevant chunks and appends to history[], then finally appends the user query to history[], but then only sends the last entry of history[] (the user query) to the LLM. This means the RAG steps do not benefit the LLM query. I'm not sure the intent of the history[-1] line, but I am certain the intent is not what the code currently does. I made a reasonable assumption that the code would be closer or equal to the author's intent if the full history[] were joined and sent to the LLM.
@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for contributing @mwarden! We will review the pull request and get back to you soon.

@shawn-jung
Copy link
Copy Markdown

one more vote for the pr. 👍

@koreyspace koreyspace merged commit 4ed80bf into microsoft:main Jan 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants